#include<stdio.h>
#include<string.h>

int a[2000010],b[2000010];

int main()
{
	long long t,n,i,j;
	while (scanf("%lld",&n)==1)
	{
		for (i=1;i<=2*n+1;i++)
			scanf("%d",&a[i]);
		memset(b,0,sizeof(b));
		for (i=1;i<=n;i++)
		{
			t=0;
			while (b[i+t]!=0)
				t++;
			for (j=i+t+1;j<=2*n+1;j++)
				if (a[i+t]==a[j]&&b[j]==0)
				{
					b[i+t]=1;
					b[j]=1;
					break;
				}
		}
		for (i=1;i<=2*n+1;i++)
			if (b[i]==0)
				printf("%d\n",a[i]);
	}
	return 0;
}
